﻿//
// *************************************************************************************
// WP-Framework
// 
// Developed by
// Lukas Kretschmar (lkretschmar.dev@bluewin.ch)
//
// Switzerland, Copyright (c) 2013 lkretschmar
// This content is released under the MIT License (http://opensource.org/licenses/MIT).
//     
// *************************************************************************************
//
//



using Microsoft.VisualStudio.TestTools.UnitTesting;
using KretschIT.WP_Fx.EasyMoq.Generator.Configurations;
using System.Reflection;
using KretschIT.WP_Fx.Testing;
using System;
using System.Linq;


namespace KretschIT.WP_Fx.EasyMoq.Generator.Tests.DefaultConfig
{
    [TestClass]
    public class EasyMoqClassConfigReaderTest
    {
        private IEasyMoqConfigReader reader;

        [TestInitialize]
        public void Init()
        {
            this.reader = new EasyMoqClassConfigReader(Assembly.GetExecutingAssembly());
        }

        [TestMethod]
        public void Test_EasyMoqConfigReaderClass()
        {
            var assembly = Assembly.GetExecutingAssembly();
            new EasyMoqClassConfigReader(assembly);
        }

        [TestMethod]
        public void Test_EasyMoqClassConfigReader_NullArgument()
        {
            ExceptionAssert.Throws<ArgumentNullException>(() =>
                {
                    new EasyMoqClassConfigReader(null);
                });
        }

        [TestMethod]
        public void Test_DefaultTargetNamespace()
        {
            Assert.AreEqual("EasyMoq.Mocking", this.reader.TargetNamespace);
        }

        [TestMethod]
        public void Test_DefaultMockables()
        {
            Assert.IsNotNull(this.reader.GetMockableInfo());
            Assert.AreEqual(0, this.reader.GetMockableInfo().Count());
        }
    }
}
